function cancel(){
    return false;
}

function ajaxForExam3() {
    var url = DomainName + "/exam3";
    var name = $("#sendName").val();
    if (checkProperty(name)) {
        url = url + "?name=" + name;
    }
    console.log(url);
    
    $.ajax({
        url: url,
        type: "get",
        cache: false,
        timeout: 60 * 1000,
        success: function(data) {
            $("#ajaxInfo").html(data);
            
        },
        error: function(data) {
            console.error(data);
        }
    });
}


function ajaxForExam4() {
    var url = DomainName + "/exam4";
    var name = $("#sendName").val();
    if (checkProperty(name)) {
        url = url + "?name=" + name;
    }
    console.log(url);
    
    $.ajax({
        url: url,
        type: "get",
        cache: false,
        timeout: 60 * 1000,
        success: function(data) {
            $("#ajaxInfo").html(data);
        },
        error: function(data) {
            console.error(data);
        }
    });
}


function ajaxForExam5() {
    var url = "exam5";
    var name = $("#sendName").val();
    url = url + "/" + name;
    console.log(url);
    
    $.ajax({
        url: url,
        type: "get",
        cache: false,
        timeout: 60 * 1000,
        success: function(data) {
            $("#ajaxInfo").html(data);
            
        },
        error: function(data) {
            console.error(data);
        }
    });
}

function ajaxForExam6() {
    var url = "exam6";
    var name = $("#sendName").val();
    url = url + "/" + name + "/param/" + name +"_2";
    console.log(url);
    
    $.ajax({
        url: url,
        type: "get",
        cache: false,
        timeout: 60 * 1000,
        success: function(data) {
            $("#ajaxInfo").html(data);
            
        },
        error: function(data) {
            console.error(data);
        }
    });
}


function ajaxForRest() {
    var url = "rest";
    console.log(url);
    
    $.ajax({
        url: url,
        type: "get",
        cache: false,
        timeout: 60 * 1000,
        success: function(data) {
            console.log(data);
            console.log(data.info);
            $("#ajaxInfo").html(JSON.stringify(data));
        },
        error: function(data) {
            console.error(data);
        }
    });
}


function ajaxForRest2() {
    var url = "rest2";
    var name = $("#sendName").val();
    if (checkProperty(name)) {
        url = url + "?name=" + name;
    }
    console.log(url);
    
    $.ajax({
        url: url,
        type: "get",
        cache: false,
        timeout: 60 * 1000,
        success: function(data) {
            console.log(data);
            console.log(data.info);
            $("#ajaxInfo").html(JSON.stringify(data));
        },
        error: function(data) {
            console.error(data);
        }
    });
}


function ajaxForRest3() {
    var url = "rest3";
    var name = $("#restName").val();
    var age = $("#restAge").val();
    var sex = $("input[type='radio']:checked").val();
    var data = {
        name : name,
        age : age,
        sex : sex
    };

    console.log(data);
    
    $.ajax({
        url: url,
        type: "post",
        data:data,
        cache: false,
        timeout: 60 * 1000,
        success: function(data) {
            console.log(data);
            console.log(data.info);
            $("#ajaxInfo").html(JSON.stringify(data));
        },
        error: function(data) {
            console.error(data);
        }
    });
}


